#include "test_list.h"

#if defined(__GNUC__) || defined(__MINGW32__) || defined(__MINGW__)
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wconversion-null"
#endif


#ifdef TEST_SELECT_BY_MASK

#define TEST_CASE_NAME os
#define TEST_NUMBER(n) SelectByMask##_##n

#include <os/mask.h>
#include <vector>

using namespace os;


#if 0
#include <string>

#if defined(__GNUC__) || defined(__MINGW__) || defined(__MINGW32__)
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wunused-variable"
    #pragma GCC diagnostic ignored "-Wconversion-null"
#endif

#ifdef _MSC_VER
    //warning C4189: local variable is initialized but not referenced
    #pragma warning(push)
    #pragma warning(disable: 4189)
#endif
#endif

#define TEST_SELECT_BY_MASK_000
#define TEST_SELECT_BY_MASK_001
#define TEST_SELECT_BY_MASK_002
#define TEST_SELECT_BY_MASK_003
#define TEST_SELECT_BY_MASK_004
#define TEST_SELECT_BY_MASK_005
#define TEST_SELECT_BY_MASK_006
#define TEST_SELECT_BY_MASK_007
#define TEST_SELECT_BY_MASK_008
#define TEST_SELECT_BY_MASK_009
#define TEST_SELECT_BY_MASK_010
#define TEST_SELECT_BY_MASK_011
#define TEST_SELECT_BY_MASK_012
#define TEST_SELECT_BY_MASK_013
#define TEST_SELECT_BY_MASK_014
#define TEST_SELECT_BY_MASK_015
#define TEST_SELECT_BY_MASK_016
#define TEST_SELECT_BY_MASK_017
#define TEST_SELECT_BY_MASK_018
#define TEST_SELECT_BY_MASK_019
#define TEST_SELECT_BY_MASK_020
#define TEST_SELECT_BY_MASK_021
#define TEST_SELECT_BY_MASK_022
#define TEST_SELECT_BY_MASK_023
#define TEST_SELECT_BY_MASK_024
#define TEST_SELECT_BY_MASK_025
#define TEST_SELECT_BY_MASK_026
#define TEST_SELECT_BY_MASK_027
#define TEST_SELECT_BY_MASK_028
#define TEST_SELECT_BY_MASK_029
#define TEST_SELECT_BY_MASK_030
#define TEST_SELECT_BY_MASK_031
#define TEST_SELECT_BY_MASK_032

//------------------------------------------------------------------------------------------------------//
namespace{


}//namespace
//------------------------------------------------------------------------------------------------------//

#ifdef TEST_SELECT_BY_MASK_000
TEST(TEST_CASE_NAME, TEST_NUMBER(000))
{
    const bool result  = SelectedByMask("test", "test");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_000


#ifdef TEST_SELECT_BY_MASK_001
TEST(TEST_CASE_NAME, TEST_NUMBER(001))
{
    const bool result = SelectedByMask("test", "*test");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_001

#ifdef TEST_SELECT_BY_MASK_002
TEST(TEST_CASE_NAME, TEST_NUMBER(002))
{
    const bool result = SelectedByMask("test", "*est");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_002

#ifdef TEST_SELECT_BY_MASK_003
TEST(TEST_CASE_NAME, TEST_NUMBER(003))
{
    const bool result = SelectedByMask("test", "?est");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_003

#ifdef TEST_SELECT_BY_MASK_004
TEST(TEST_CASE_NAME, TEST_NUMBER(004))
{
    const bool result = SelectedByMask("test", "?test");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_004

#ifdef TEST_SELECT_BY_MASK_005
TEST(TEST_CASE_NAME, TEST_NUMBER(005))
{
    const bool result = SelectedByMask("test", "+est");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_005

#ifdef TEST_SELECT_BY_MASK_006
TEST(TEST_CASE_NAME, TEST_NUMBER(006))
{
    const bool result = SelectedByMask("est", "+est");
    EXPECT_EQ(false, result);
}
#endif // TEST_SELECT_BY_MASK_006

#ifdef TEST_SELECT_BY_MASK_007
TEST(TEST_CASE_NAME, TEST_NUMBER(007))
{
    const bool result = SelectedByMask("image001.png", "*imag*.png");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_007


#ifdef TEST_SELECT_BY_MASK_008
TEST(TEST_CASE_NAME, TEST_NUMBER(008))
{
    const bool result = SelectedByMask("image001.png", "+mag*.png");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_008

#ifdef TEST_SELECT_BY_MASK_009
TEST(TEST_CASE_NAME, TEST_NUMBER(009))
{
    const bool result = SelectedByMask("pmage001.png", "+mag*.png");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_009

#ifdef TEST_SELECT_BY_MASK_010
TEST(TEST_CASE_NAME, TEST_NUMBER(010))
{
    const bool result = SelectedByMask(".ignore", ".*");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_010

#ifdef TEST_SELECT_BY_MASK_011
TEST(TEST_CASE_NAME, TEST_NUMBER(011))
{
    const bool result = SelectedByMask(".ig.nore", ".*");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_011

#ifdef TEST_SELECT_BY_MASK_012
TEST(TEST_CASE_NAME, TEST_NUMBER(012))
{
    const bool result = SelectedByMask("test.ig.nore", ".*");
    EXPECT_EQ(false, result);
}
#endif // TEST_SELECT_BY_MASK_012

#ifdef TEST_SELECT_BY_MASK_013
TEST(TEST_CASE_NAME, TEST_NUMBER(013))
{
    const bool result = SelectedByMask("test.ig.nore", "t+++.ig.n*");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_013

#ifdef TEST_SELECT_BY_MASK_014
TEST(TEST_CASE_NAME, TEST_NUMBER(014))
{
    const bool result = SelectedByMask("tes.ig.nore", "t+++.ig.n*");
    EXPECT_EQ(false, result);
}
#endif // TEST_SELECT_BY_MASK_014

#ifdef TEST_SELECT_BY_MASK_015
TEST(TEST_CASE_NAME, TEST_NUMBER(015))
{
    const bool result = SelectedByMask("libden.lib", "*den.lib");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_015

#ifdef TEST_SELECT_BY_MASK_016
TEST(TEST_CASE_NAME, TEST_NUMBER(016))
{
    const bool result = SelectedByMask("den.lib", "?den.lib");
    EXPECT_EQ(true, result);
}
#endif // TEST_SELECT_BY_MASK_016

#ifdef TEST_SELECT_BY_MASK_017
TEST(TEST_CASE_NAME, TEST_NUMBER(017))
{
    EXPECT_EQ(true,  SelectedByMask("mylib.txt"     , "*.txt"     ));
    EXPECT_EQ(false, SelectedByMask("mylib.txt"     , "*.lib"     ));
    EXPECT_EQ(true,  SelectedByMask("mylib.txt"     , "m*.t*"     ));
    EXPECT_EQ(false, SelectedByMask("lib.txt"       , "m*.t*"     ));
    EXPECT_EQ(true,  SelectedByMask("mylib-32-d.lib", "*-32-d.lib"));
    EXPECT_EQ(false, SelectedByMask("mylib-32.lib"  , "*-32-d.lib"));
}
#endif // TEST_SELECT_BY_MASK_017

#ifdef TEST_SELECT_BY_MASK_018
TEST(TEST_CASE_NAME, TEST_NUMBER(018))
{
    std::vector<str> masks;

    masks.push_back("_*");
    masks.push_back(".*");
    masks.push_back("ignor*");
    masks.push_back("*.*ignor*");

    EXPECT_EQ(true,  SelectedByMask("_mylib.txt"         , masks ));
    EXPECT_EQ(true,  SelectedByMask(".dep"               , masks ));
    EXPECT_EQ(true,  SelectedByMask("ignored.cpp"        , masks ));
    EXPECT_EQ(true,  SelectedByMask("manager.cpp_ignore" , masks ));
}
#endif // TEST_SELECT_BY_MASK_018

#ifdef TEST_SELECT_BY_MASK_019
TEST(TEST_CASE_NAME, TEST_NUMBER(019))
{
    std::vector<str> masks;

    masks.push_back("_*");
    masks.push_back(".*");
    masks.push_back("ignor*");
    masks.push_back("*.*ignor*");

    typedef std::vector<str>::iterator
        It;

    It found = FindMask("_mylib.txt", masks);
    EXPECT_EQ(4,  masks.size() );
    EXPECT_EQ("_*",  *found);
}
#endif // TEST_SELECT_BY_MASK_019

#ifdef TEST_SELECT_BY_MASK_020
TEST(TEST_CASE_NAME, TEST_NUMBER(020))
{
}
#endif // TEST_SELECT_BY_MASK_020

#ifdef TEST_SELECT_BY_MASK_021
#endif // TEST_SELECT_BY_MASK_021

#ifdef TEST_SELECT_BY_MASK_022
#endif // TEST_SELECT_BY_MASK_022

#ifdef TEST_SELECT_BY_MASK_023
#endif // TEST_SELECT_BY_MASK_023

#ifdef TEST_SELECT_BY_MASK_024
#endif // TEST_SELECT_BY_MASK_024

#ifdef TEST_SELECT_BY_MASK_025
#endif // TEST_SELECT_BY_MASK_025

#ifdef TEST_SELECT_BY_MASK_026
#endif // TEST_SELECT_BY_MASK_026

#ifdef TEST_SELECT_BY_MASK_027
#endif // TEST_SELECT_BY_MASK_027

#ifdef TEST_SELECT_BY_MASK_028
#endif // TEST_SELECT_BY_MASK_029

#ifdef TEST_SELECT_BY_MASK_030
#endif // TEST_SELECT_BY_MASK_030

#ifdef TEST_SELECT_BY_MASK_031
#endif // TEST_SELECT_BY_MASK_031

#ifdef TEST_SELECT_BY_MASK_032
#endif // TEST_SELECT_BY_MASK_032


#if defined(__GNUC__) || defined(__MINGW32__) || defined(__MINGW__)
    #pragma GCC diagnostic pop
#endif


#endif



